#ifndef TOOLBAR_H
#define TOOLBAR_H

#include "ToolManager.h"

class ToolButton;

class QUINCE_GUI_EXPORT ToolBar : public QToolBar, public ToolManager
{
    Q_OBJECT
public:
    ToolBar(const QString &title, QMainWindow *parent, int nbColumn);
    virtual ~ToolBar();

    virtual void addTool(ToolBase *tool);
    virtual void selectTool(ToolBase *tool);
    virtual void removeTool(ToolBase *tool);
public Q_SLOTS:
    void buttonClicked(QWidget *button);

private:
    ToolButton * getButton(ToolBase * tool) const;

    QSignalMapper *m_mapper;

    typedef map<ToolBase *, ToolButton *> ToolButtonMap;
    ToolButtonMap m_toolMap;

    int m_nbColumn;
};

#endif // TOOLBAR_H
